Software refers to programs: the instructions that the computer executes to perform tasks. Embedded systems contain limited instruction sets and only perform specific tasks, while general-purpose computer can run a range of tasks.
System software controls the hardware of a computer system. This includes:
Application software is designed to perform user-facing tasks. This includes web browsers, word processors, video editors, etc. Application software can be categorised into general purpose (used for a variety of tasks), special purpose (only used for one specific task), or bespoke (developed for the client's specific requirements).
Hardware is the physical components of a computer system. The 'three-box model', which describes a von Neumann machine, consists of a processor, main memory, and I/O controllers, all linked by a system bus. Computers also have additional hardware (peripherals), which include secondary storage, and input/output devices.
In the von Neumann architecture, instructions and data are stored together in main memory; they are in fact indistinguishable. von Neumann is used extensively in general purpose computing systems. In the Harvard architecture, instructions and data are stored in separate memory spaces accessed by different buses. The Harvard architecture is used extensively in embedded systems such as digital signal processing (DSP).
Machine code instructions stored in main memory are fetched and executed serially by a processor that performs arithmetic and logical operations.
The processor executes the instructions that allow the computer to perform tasks. It contains:
Dedicated registers include:
Fetch
Number of cores
In a traditional computer, instructions are fetched and executed one at a time. Modern computers have processors with multiple cores, which can theoretically independently execute instructions simultaneously, each running their own fetch-execute cycle. However, software needs to be written such that it can use multiple processor cores.
Amount and type of cache
Cache is a small amount of very fast memory inside the processor. When an instruction or piece of data is fetched from main memory, it is copied from the cache, so that if the same instruction or data is needed again, it can be fetched from cache, which is faster than accessing main memory. Processors typically contains three levels of cache, ranging from L1, which is fastest but the smallest, to L3.
Clock speed
All processor activities start on a clock pulse. The faster the clock speed, the more instructions that can be executed per second. Typical modern computers have clock speeds around 3 GHz.
Bus width
The width of the data bus affects how many bits are processed simultaneously. Therefore, a larger data bus width can reduce the number of instructions needed to process a given amount of data, increasing performance e.g. a 32 bit data bus only requires one memory read to read 32 bits while a 16 bit bus requires 2.
Interrupts
Interrupts are signals sent by a software program or hardware device to the processor. For example, a hardware issue could cause an interrupt. When the CPU receives an interrupt, it stops execution of the current program and calls an Interrupt Service Routine (ISR) to process the interrupt.
When an interrupt occurs:
A bus is a set of parallel wires that connects different components of a computer.
The control bus is bi-directional and transmits command, timing, and status information between system components. Control lines include:
The data bus typically consists of 8, 16, 32, or 64 lines, and provides a bi-directional path for transmitting data and instructions between system components. The width of the data bus is extremely important for system performance, as it determines how much data is typically processed in one instruction.
Memory is divided into words, and each word is given an address. The address bus is used by the processor to select which address to read / write in memory. The width of the address bus determines the maximum memory capacity of the system.
Immediate addressing: the operand is the datum.
Direct addressing: the operand is the memory address of the datum (could be main memory address or a register).
A hard disk drive contains multiple rapidly spinning platters with a magnetic coating. Each platter consists of concentric tracks and radially segmented sectors. Each platter has a read-write head, which moves radially to access different tracks. To read and write data, the read-write head moves to the desired sector. To read, the head uses an electromagnet to change the magnetic polarity of specific areas in the sector, with one polarity representing a binary 1 and the other representing a 0. To write, an electromagnetic records the changing polarity and converts this to a binary signal.
A SSD has NAND flash memory and a controller that manages pages, and blocks and complexities of writing. NAND flash memory is based on floating gate transistors that trap and store charge. A block is made up of many pages. Pages cannot be overwritten - the page has to be erased before it can be written to, but technology requires the whole block to be erased. SSDs have lower latency and faster transfer speeds than a magnetic disk drive.
To write data to an optical disk, the disk is rotated in a disk drive. There is a single spiral track on the disk. A laser inside the drive moves to access different areas of the track, physically burning a pattern on the surface coating of the disk. To read data from an optical disk, the same process is used except with a weaker laser where the laser beam reflects off the surface of the disk. The changes between areas of different reflectance (lands and pits) is detected by a photodiode, and the signal is processed to become a digital binary signal.
A barcode reader has a light source that illuminates the bars. The white and black bars reflect light differently, which is converted to an electrical signal by a sensor. The signal is decoded to obtain the barcode's store data.
A digital camera has a camera sensor. When the shutter is opened, light falls onto the camera sensor, which has a matrix of photodioides (typically CCD or CMOS). The light causes an amount of charge to build in each photosensor proportional to the brightness of light, which is then sensed and converted into a digital value by an ADC (analogue to digital converter). Each cell is covered by 1 blue, 1 red, and 2 green filters (Bayer filter).
CCD sensors are used for low-noise applications such as astrophotography. CCD is also used in profession photography where quality is important. CMOS is used in mobile devices where minimising power consumption is important.
There is a photosensitive drum that is negatively charged. A laser scans across the drum through an optical lens and mirror mechanism, turning on and off to apply the bitmap data onto the drum. The laser causes the drum's charge to be neutralised where it scans over. The pattern of charge on the drum surface is an image of the page to be printed. The charged drum is exposed to toner, where the negatively charged areas repel toner, while the neutral areas attract toner. The drum then rolls over a piece of positively charged paper, transferring the toner pattern onto the paper. The toner is then passed through heated rollers to fuse the toner to the paper.
RFID is a method of identifying items using radio waves. A reader communicates with a transponder in a RFID tag to transmit digital information over radio waves.
An RFID tag is a microchip with an antenna, which is packaged in a way to be applied to an object. The tag contains a transponder that picks up signals from and transmits signals to a reader. RFID tags can be used without a line of sight.